package main

import "fmt"

type La struct {
	name string
	age int
}

type Ls struct {
	*La //指针类型
	id int
}

func main()  {
	a := Ls{&La{"aaa", 22}, 55}
	fmt.Println(a.age, a.name, a.id)

	//先定义变量，然后分配空间
	var b Ls
	b.La = new(La) //分配空间
	b.name = "BBBB"
	b.age = 19
	b.id = 23
	fmt.Println(b.age, b.name, b.id)
}
